<div class="search-wrap">
  <div class="search-top">
    <img src="/assets/images/statistic-analysis/bg48.jpg" alt="">
    <div class="div-time">
      <strong>开始日期：</strong>
      <nv-date-picker class="patient_date time-val" [(ngModel)]="searchParams['start_date']" [nvAllowClear]=false 
                            nvPlaceHolder="" nvShowTime></nv-date-picker>
      <strong class="two-str">结束日期：</strong>
      <nv-date-picker class="patient_date time-val" [nvDisabledDate]="disabledDate" [(ngModel)]="searchParams['end_date']" [nvAllowClear]=false 
      nvPlaceHolder="" nvShowTime></nv-date-picker>
    </div>
  </div>
  <div class="search-ccc">
    <div class="m-b">
      <strong>科室：</strong>
      <nv-select style="width: 110px;" [(ngModel)]="searchParams['department']" (ngModelChange)="getYisheng()" nvAllowClear>
        <!-- <nv-option nvValue="全部" nvLabel="全部"></nv-option>
        <nv-option nvValue="内科" nvLabel="内科"></nv-option>
        <nv-option nvValue="外科" nvLabel="外科"></nv-option>
        <nv-option nvValue="妇科" nvLabel="妇科"></nv-option>
        <nv-option nvValue="儿科" nvLabel="儿科"></nv-option> -->
        <nv-option nvValue="全部" nvLabel="全部"></nv-option>
        <nv-option *ngFor="let option of keshiOptions" [nvLabel]="option" [nvValue]="option"></nv-option>
      </nv-select>

      <strong class="m-l">医生：</strong>
      <nv-select style="width: 110px;" [(ngModel)]="searchParams['doctor']" nvAllowClear>
        <!-- <nv-option nvValue="全部" nvLabel="全部"></nv-option>
        <nv-option nvValue="内科" nvLabel="内科"></nv-option>
        <nv-option nvValue="外科" nvLabel="外科"></nv-option>
        <nv-option nvValue="妇科" nvLabel="妇科"></nv-option>
        <nv-option nvValue="儿科" nvLabel="儿科"></nv-option> -->
        <nv-option nvValue="全部" nvLabel="全部"></nv-option>
        <nv-option *ngFor="let option of yishengOptions" [nvLabel]="option" [nvValue]="option"></nv-option>
      </nv-select>

      <strong class="m-l">处方类型：</strong>
      <nv-select style="width: 110px;" [(ngModel)]="searchParams['type']" nvAllowClear>
        <nv-option nvValue="全部" nvLabel="全部"></nv-option>
        <nv-option nvValue="饮片" nvLabel="饮片"></nv-option>
        <nv-option nvValue="中成药" nvLabel="中成药"></nv-option>
        <nv-option nvValue="协定方" nvLabel="协定方"></nv-option>
        <nv-option nvValue="经典方" nvLabel="经典方"></nv-option>
      </nv-select>

      <strong class="m-l">病人性质：</strong>
      <nv-select style="width: 110px;" [(ngModel)]="searchParams['病人性质']" nvAllowClear>
        <nv-option nvValue="全部" nvLabel="全部"></nv-option>
        <nv-option nvValue="医保" nvLabel="医保"></nv-option>
        <nv-option nvValue="自费" nvLabel="自费"></nv-option>
      </nv-select>
    </div>
    <div>
      <strong>归经：</strong>
      <nv-select  style="width: 260px" nvMode="multiple"  [(ngModel)]="searchParams['guijing']">
        <nv-option nvValue="全部" nvLabel="全部"></nv-option>
        <nv-option *ngFor="let option of guijingOptions" [nvLabel]="option" [nvValue]="option"></nv-option>
      </nv-select>

      <strong class="m-l">药性：</strong>
      <nv-select  style="width: 260px" nvMode="multiple"  [(ngModel)]="searchParams['xingwei']">
        <nv-option nvValue="全部" nvLabel="全部"></nv-option>
        <nv-option *ngFor="let option of yaoxingOptions" [nvLabel]="option" [nvValue]="option"></nv-option>
      </nv-select>

      <input type="image" src="/assets/images/statistic-analysis/bg49.jpg" name="button3" (click)="onSubmit()"
                                    id="button3" value="提交">
    </div>
  </div>
</div>
<!-- <p class="div-c" class="nodata"> 请填写分析条件，然后进行分析！</p> -->
<table width="100%" >
  <tbody>
    <tr>
      <td class="div-c">
        <p style="font-size:16px"><strong>用药分析统计报告</strong></p>
        <table width="95%" >
          <tbody>
            <tr>
              <td height="30" class="link_black"><strong>科室：</strong></td>
              <td class="link_black">{{anySearchRes.department}}&nbsp;</td>
              <td class="link_black"><strong>医生：</strong></td>
              <td class="link_black">{{anySearchRes.doctor}}&nbsp;</td>
              <td class="link_black"><strong>处方类型：</strong></td>
              <td class="link_black">{{anySearchRes.type}}&nbsp;</td>
              <td class="link_black"><strong>病人性质：</strong></td>
              <td class="link_black">{{anySearchRes['病人性质']}}&nbsp;</td>
              <td class="link_black"><strong>开始日期：</strong></td>
              <td class="link_black">{{datePipe.transform(anySearchRes.start_date, 'yyyy-MM-dd HH:mm:ss')}}&nbsp;</td>
              <td class="link_black"><strong>结束日期：</strong></td>
              <td class="link_black">{{datePipe.transform(anySearchRes.end_date, 'yyyy-MM-dd HH:mm:ss')}}&nbsp;</td>
            </tr>
            <tr>
              <td class="link_black"><strong>归经：</strong></td>
              <td class="link_black">{{anySearchRes['guijing']}}&nbsp;</td>
              <td class="link_black"><strong>药性：</strong></td>
              <td class="link_black">{{anySearchRes['xingwei']}}&nbsp;</td>
            </tr>
          </tbody>
        </table>
        
        <p>&nbsp;</p>
        <p *ngIf="resultsObj" class="link_black curr-p">本次分析共统计患者<strong class="link_red">{{resultsObj['患者数']}}</strong>人，处方<strong class="link_red">{{resultsObj['处方数']}}</strong>张。基本情况如下：</p>
        <p><strong>证型分布/饮片使用排名</strong></p>
        <div>
          <div class="echartsContent"  echarts [options]="zhengxingOptions" style="width:619px;height:578px;margin:0 auto;"></div>
        </div>
        <div>
          <div class="echartsContent"  echarts [options]="yinpianOptions" style="width:624px;height:589px;margin:0 auto;"></div>
        </div>
        <p><strong>中药饮片性味、功效分析排名</strong></p>
        <div>
          <div class="echartsContent"  echarts [options]="zhongyaoyinOptions" (chartClick)="onChartEvent($event)" style="width:731px;height:480px;margin:0 auto;"></div>
        </div>
        <table class="results-wwap-table">
          <tbody>
            <tr class="thead">
              <td width="50" class="link_black">
                <div class="div-c"><strong>序号</strong></div>
              </td>
              <td width="120" class="link_black" *ngFor="let item of gongxiaoTableData['head']">
                <div class="div-c"><strong>{{item}}</strong></div>
              </td>
            </tr>
            <tr *ngFor="let item of gongxiaoTableData['bodys']; index as i;">
              <td width="50" class="link_black">
                <div class="div-c">{{i + 1}}</div>
              </td>
              <td *ngFor="let val of item; index as j" width="120" class="link_black">
                <div  class="div-c" [class.link_red]="j == item.length-1">{{val}}</div>
              </td>
            </tr>
           
          </tbody>
        </table>
        <p class="div-c cha" *ngIf="!moreGongxiaoTableData">
          <a href="javascript:;" (click)="getGongxiaofenxi()" class="link_black">查看更多</a>
        </p>
        <p class="div-c cha" *ngIf="moreGongxiaoTableData">
          <a href="javascript:;" (click)="getGongxiaofenxi()" class="link_black">收起更多</a>
        </p>
        <p class="m-to"><strong>中成药使用排名</strong></p>
        <div>
          <div class="echartsContent"  echarts [options]="zhongshiyongOptions" style="width:796px;height:580px;margin:0 auto;"></div>
        </div>
        <p><strong>协定方使用排名</strong></p>
        <div>
          <div class="echartsContent"  echarts [options]="xiedingfangOptions" style="width:796px;height:580px;margin:0 auto;"></div>
        </div>
        <p><strong>经典方使用排名</strong></p>
        <div>
          <div class="echartsContent"  echarts [options]="jingdianfangOptions" style="width:796px;height:580px;margin:0 auto;"></div>
        </div>
        <p><strong>名贵药物排名</strong></p>
        <div>
          <div class="echartsContent"  echarts [options]="mingguiyaoOptions" style="width:796px;height:580px;margin:0 auto;"></div>
        </div>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
      </td>
    </tr>
  </tbody>
</table>
<p>&nbsp;</p>
<table class="fotter-table">
  <tbody>
    <tr>
      <td class="footer-td-one" ></td>
    </tr>
    <tr>
      <td class="footer-td-two"><span class="link_black">上海市中医文献馆版权所有</span></td>
    </tr>
  </tbody>
</table>
<p>&nbsp;</p>